rem  compiler install path
set  CC=D:/ti/ccs1280/ccs/tools/compiler/ti-cgt-arm_20.2.7.LTS/bin/armcl
set  AR=D:/ti/ccs1280/ccs/tools/compiler/ti-cgt-arm_20.2.7.LTS/bin/armar

rem matlab install path
set  MAT_DIR=D:\Matlab\R2010b
set  SIMU_DIR=%MAT_DIR%\simulink\include
set  EXT_DIR=%MAT_DIR%\extern\include
set  RTW_DIR=%MAT_DIR%\rtw

rem matlab include path
set  MAT_INCLUDE_PATH=--include_path="%MAT_DIR%\toolbox\dspblks\include" --include_path=".\control2_ert_rtw" --include_path="%SIMU_DIR%" --include_path="%EXT_DIR%" --include_path="%RTW_DIR%\c\src" --include_path="%RTW_DIR%\c\libsrc" --include_path="%RTW_DIR%\c\src\ext_mode\common" --include_path="%RTW_DIR%\c\src\ext_mode\serial" --include_path="%RTW_DIR%\c\src\ext_mode\custom" --include_path="%MAT_DIR%\sys\lcc\include "  --include_path="%MAT_DIR%/rtw/c/src"

rem Model name
set  MDL=control2
set  MDL_RTW_DIR=E:\matlab\sfunction\%MDL%%_ert_rtw

rem c project 
set  TI_WORK_PATH=--include_path="D:/ti/workspace_v12/AOCS"
set  TI_CC_PATH=--include_path="D:/ti/ccs1280/ccs/tools/compiler/ti-cgt-arm_20.2.7.LTS/include"

rem  compiler  argument
set  CC_ARGU=-mv7R5 --code_state=32 --float_support=VFPv3D16 -me  %MAT_INCLUDE_PATH% %TI_WORK_PATH%  %TI_CC_PATH%  -g --diag_warning=225 --diag_wrap=off --display_error_number --enum_type=packed --abi=eabi --preproc_with_compile --preproc_dependency="aocs.d_raw" 

set RM=del

rem compiler c file

%CC% %CC_ARGU% %MAT_DIR%\toolbox\rtw\dspblks\c\dspqsrt\sort_qk_val_d_rt.c

%CC% %CC_ARGU%  %MDL_RTW_DIR%\%MDL%.c

%CC% %CC_ARGU%  %MDL_RTW_DIR%\%MDL%_data.c

%CC% %CC_ARGU%  %MDL_RTW_DIR%\rt_nonfinite.c

%CC%  %CC_ARGU%  %MDL_RTW_DIR%\rtGetInf.c

%CC% %CC_ARGU%  %MDL_RTW_DIR%\rtGetNaN.c

rem  ar  obj file
%RM% .\libaocs.a

%AR%  -r libaocs.a %MDL%.obj %MDL%_data.obj rt_nonfinite.obj rtGetInf.obj rtGetNaN.obj sort_qk_val_d_rt.obj
